#ifndef LEXER_H

#define LEXER_H

#include "ast.h"

extern const char *ILLEGAL;
extern const char *MEOF;
extern const char *IDENT;
extern const char *INT;
// 运算符
extern const char *ASSIGN;
extern const char *PLUS;
extern const char *MINUS;
extern const char *BANG;
extern const char *ASTERISK;
extern const char *SLASH;

extern const char *LT;
extern const char *GT;
extern const char *EQ;
extern const char *NOT_EQ;

extern const char *COMMA;
extern const char *SEMICOLON;
extern const char *LPAREN;
extern const char *RPAREN;
extern const char *LBRACE;
extern const char *RBRACE;

// 关键字
extern const char *FUNCTION;
extern const char *LET;
extern const char *TRUE;
extern const char *FALSE;
extern const char *IF;
extern const char *ELSE;
extern const char *RETURN;

struct s_lexer
{
    char input[1024];
    int position;
    int readPosition;
    char ch;
};

struct s_lexer new_s_lexer(const char *str);
void s_lexer_read_char(struct s_lexer *l);
struct s_token s_lexer_next_token(struct s_lexer *l);
// char s_lexer_peek_char(struct  s_lexer *l);

#endif
